
init()

/**
 * 初始化界面
 */
function init() {
    queryWarehouseList();
}

/**
 * 查询仓库列表
 */
function queryWarehouseList() {
    $.ajax({
        url :   "http://localhost:8080/userCore/warehouse/selectwarehouse",
        type:   "post",
        data:JSON.stringify({}),
        contentType:"application/json;",
        success:function(data) {
            console.log(data);
            var firstMaterialHtml = "";
            var list = data.data;
            for(var i=0; i<list.length; i++){
                firstMaterialHtml = firstMaterialHtml
                    +'<option style="text-align: center;" value="'
                    +list[i].typeCode
                    +'">'
                    +list[i].typeName
                    +'</option>';
            }
            $("#firstMaterial").html(firstMaterialHtml);
            if(list != null && list.length > 0){
                initMaterialTwoType(list[0].typeCode);
            }
        }
    });
}